package bb.lanxing.lib.devices.ble.ble.characteristic.light;

import java.nio.ByteBuffer;
import java.util.Arrays;
import kotlin.Metadata;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;

public final class LightControlPointRequest {
    private final LightControlPointOpCode requestOpCode;
    private final byte[] requestParameter;

    public static /* synthetic */ LightControlPointRequest copy$default(LightControlPointRequest lightControlPointRequest, LightControlPointOpCode lightControlPointOpCode, byte[] bArr, int i, Object obj) {
        if ((i & 1) != 0) {
            lightControlPointOpCode = lightControlPointRequest.requestOpCode;
        }
        if ((i & 2) != 0) {
            bArr = lightControlPointRequest.requestParameter;
        }
        return lightControlPointRequest.copy(lightControlPointOpCode, bArr);
    }

    public LightControlPointOpCode component1() {
        return this.requestOpCode;
    }

    public byte[] component2() {
        return this.requestParameter;
    }

    public LightControlPointRequest copy(LightControlPointOpCode requestOpCode, byte[] bArr) {
        Intrinsics.checkNotNullParameter(requestOpCode, "requestOpCode");
        return new LightControlPointRequest(requestOpCode, bArr);
    }

    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (!(obj instanceof LightControlPointRequest lightControlPointRequest)) {
            return false;
        }
        return this.requestOpCode == lightControlPointRequest.requestOpCode && Intrinsics.areEqual(this.requestParameter, lightControlPointRequest.requestParameter);
    }

    public int hashCode() {
        int hashCode = this.requestOpCode.hashCode() * 31;
        byte[] bArr = this.requestParameter;
        return hashCode + (bArr == null ? 0 : Arrays.hashCode(bArr));
    }

    public String toString() {
        return "LightControlPointRequest(requestOpCode=" + this.requestOpCode + ", requestParameter=" + Arrays.toString(this.requestParameter) + ')';
    }

    public LightControlPointRequest(LightControlPointOpCode requestOpCode, byte[] bArr) {
        Intrinsics.checkNotNullParameter(requestOpCode, "requestOpCode");
        this.requestOpCode = requestOpCode;
        this.requestParameter = bArr;
    }

    public /* synthetic */ LightControlPointRequest(LightControlPointOpCode lightControlPointOpCode, byte[] bArr, int i, DefaultConstructorMarker defaultConstructorMarker) {
        this(lightControlPointOpCode, (i & 2) != 0 ? null : bArr);
    }

    public LightControlPointOpCode getRequestOpCode() {
        return this.requestOpCode;
    }

    public byte[] getRequestParameter() {
        return this.requestParameter;
    }

    public byte[] convertByteArray() {
        byte[] bArr = this.requestParameter;
        if (bArr == null) {
            byte[] array = ByteBuffer.allocate(1).put((byte) this.requestOpCode.getValue()).array();
            Intrinsics.checkNotNullExpressionValue(array, "allocate(1).put(requestO…e.value.toByte()).array()");
            return array;
        }
        byte[] array2 = ByteBuffer.allocate(bArr.length + 1).put((byte) this.requestOpCode.getValue()).put(this.requestParameter).array();
        Intrinsics.checkNotNullExpressionValue(array2, "allocate(requestParamete…requestParameter).array()");
        return array2;
    }
}
